package LeetCode;

/**
 * @Classname LC633
 * @Description // https://leetcode-cn.com/problems/sum-of-square-numbers/ 双指针
 * @Date 2021/4/28 11:24
 * @Created by yin
 */
public class LC633 {
    public boolean judgeSquareSum(int c) {
        int i =0,j = (int)Math.sqrt(c);
        int t;
        while(i<=j){
            t  =i*i + j*j ;
            if(t>c) j--;
            if(t<c) i++;
            if(t==c) return true;
        }
        return false;
    }
}
